home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / misc / unix / unix_boot.lha / src / streqn.c < prev    next >
Encoding:
Text File  |  1991-12-09  |  339 b   |  16 lines

  1. /*
  2.  *  Copyright (C) 1991, Commodore Business Machines, Inc.
  3.  *
  4.  *  Compare first N bytes of two strings, returning 0 if they are not
  5.  *  equal and non-zero if they are.
  6.  */
  7.  
  8. int streqn (char *s1, char *s2, int nbytes)
  9. {
  10.     while ((*s1 != '\000') && (*s1 == *s2) && (--nbytes > 0)) {
  11.     s1++;
  12.         s2++;
  13.     }
  14.     return (*s1 == *s2);
  15. }
  16.